/*
 * Copyright(C) 2010 Luvina Software Company
 *
 * TestLogicImpl.java, Oct 29, 2010 ntmhuong
 */
package net.luvina.manageuser.logic.impl;

import java.util.List;

import net.luvina.manageuser.dao.TestDao;
import net.luvina.manageuser.dto.TestDto;
import net.luvina.manageuser.hibernate.User;
import net.luvina.manageuser.hibernate.UserGrp;
import net.luvina.manageuser.logic.TestLogic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Service logic of tbl_user
 *
 * @version 1.0
 * @author tranviethung
 *
 */
@Service("userLogic")
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, readOnly = false, rollbackFor = { Throwable.class })
public class TestLogicImpl implements TestLogic {
    @Autowired
    private TestDao testDao;

    /*
     * (non-Javadoc)
     *
     * @see net.luvina.manageuser.logic.TestLogic#findUser()
     */
    public List<TestDto> findUser() {
        return this.testDao.findUser();
    }

    /*
     * (non-Javadoc)
     *
     * @see net.luvina.manageuser.logic.TestLogic#getGroupList()
     */
    public List<UserGrp> getGroupList() {
        return this.testDao.getGroupList();
    }

    /*
     * (non-Javadoc)
     *
     * @see net.luvina.manageuser.logic.TestLogic#getListUser(int, int, int,
     * java.lang.String)
     */
    public List<User> getListUser(int offset, int limit, int userGrpId,
            String userName) {
        return this.testDao.getListUser(offset, limit, userGrpId, userName);
    }

    /*
     * (non-Javadoc)
     *
     * @see net.luvina.manageuser.logic.TestLogic#getTotalRecords(int,
     * java.lang.String)
     */
    public int getTotalRecords(int userGrpId, String userName) {
        return this.testDao.getTotalRecords(userGrpId, userName);
    }

}
